/**
 * 用于class name merge
 */

import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

export function checkExistOrFail<T>(value: T | undefined): T {
  if (value === undefined) throw new Error('undefined!');

  return value;
}
